/*
**      Newton Developer Technical Support Sample Code
**
**      CharEdit, an example of the "comb editor" protoCharEdit
**
**      by Bob Ebert & J. Christopher Bell Newton Developer Technical Support
**
**      Copyright  1994-5 by Apple Computer, Inc.  All rights reserved.
**
**      You may incorporate this sample code into your applications without
**      restriction.  This sample code has been provided "AS IS" and the
**      responsibility for its operation is 100% yours.  You are not
**      permitted to modify and redistribute the source as "DTS Sample Code."
**      If you are going to re-distribute the source, we require that you
**      make it clear in the source that the code was descended from
**      Apple-provided sample code, but that you've made changes.
*/

This example shows the basics of the CharEdit proto, the letter-by-letter
editor built into Newton 2.0. Note that the floater which is triggered by
the corrector popup (when you double tap on a word) uses this proto but
does not have its own proto. It is more like a built-in application used
by the recognition system.  The full corrector proto is not provided, if
you wish to duplicate it, you'll have to build your own view starting with
a protoCharEdit view.

The protoCharEdit proto will allow you to restrict character recognition
to specialized sets of characters, or even fix a character so that it
cannot be edited by the user.

The sample shows several different ways of using the protoCharEdit, using
these fields/data types.  (Tap on the data display to set up the charEdit
view for editing that data.)

CADL (California Drivers License) is a simple template-based editor.

Date is a locale-specific editor, pulled from the OS.

Amount is a custom template which uses SetupString and CleanupString methods.

Phone is a simple template based editor with non-editable characters.

SocSec (Social Security Number) is a simple template based editor that is
  too wide to fit in the view provided, and so must be scrolled.
 
FreeForm is an unformatted editor that allows entering of any text.


The base view provides two methods which keep the editor in sync with the
display.  SetupEditor sets up the editor for a given field, and SyncText
takes the edited text out of the editor and puts it back in the field.

The protoCharEdit view itself calls SyncText every time the data is edited,
to demonstrate use of the DisplayExternal method.  You may wish to design
your application to instead only pull the data out of the editor when
the view is closed.  (If, for example, the editor is contained in a floating
window.)
